Action Parameter Constants
-
kActionParameter
-
This atom describes one parameter for a given action. Add one atom of this type, as a child of the
kAction
atom, for each parameter that the action requires. The number of parameters and their data types is described for each action in the section
"Action Constants"
.
-
The atom's index, not ID, correspond to the action's parameter numbers. The atom commonly contains leaf data with the same type as its parameter's data type. If the data type is numeric, then it may be described by an expression, in which case it would have a child atom of type
kExpressionContainerAtomType
. For the case and while statement actions the
kActionParameter
always has a
kConditionalAtomType
child atom.
-
kActionFlags
-
This optional atom may be used to specify flags which modify a parameter's value. The leaf data of this atom is a
long
which contains the flags. The ID of this atom must be set to the ID of the corresponding
kActionParameter
atom which it modifies. This atom's parent is a
kAction
atom.
-
The following
flags may be used. Note that the action flags work in conjunction with the values specified by the
kActionParameterMinValue
and
kActionParameterMaxValue
atoms.
-
kActionFlagActionIsDelta
-
The parameter's value will be added to the current value instead of replacing the current value. This is useful, for example, if you want an action to increment a Movie's volume by a fixed amount. The new value will be pinned to the minimum and maximum values. Use the
kActionParamMinValue
and
kActionParamMaxValue
atoms to set the minimum and maximum values. You set this flag in the leaf data of a
kActionFlags
atom.
-
When this flag is set, the parameter value is interpreted as a signed value, allowing the delta to be positive or negative. This is true even if the parameter itself is normally an unsigned value, such as an entry of a graphic mode's
RGBColor
.
-
kActionFlagParameterWrapsAround
-
If after applying the parameter to the current value the new value is greater than the maximum value or less than the minimum value, then the value wraps around to a value which is in range.
-
This is useful, for example, if you want to create an action to cycle between sprite image indices, or layers. Use the
kActionParamMinValue
and
kActionParamMaxValue
atoms to set the minimum and maximum values. You set this flag in the leaf data of a
kActionFlags
atom.
-
kActionFlagActionIsToggle
-
This flag is supported by actions with a single two state parameter. If this flag is set, the parameter value is ignored, and instead the current value is toggled to its other state. This is useful, for example, if you want a single action to toggle a sprite's visibility between visible and invisible. You set this flag in the leaf data of a
kActionFlags
atom.
-
kActionParameterMinValue
-
You add an atom of this type for each parameter which you wish to enforce a minimum value upon. Action parameters have default minimum values, so you only need to add this atom if you wish to override this default value. The atom ID should match the ID of the associated
kActionParameter
atom. Note that not all actions support this optional atom. This atom's parent is a
kAction
atom. The size of the leaf data depends on the parameter's data type.
-
kActionParameterMaxValue
-
Add an atom of this type for each parameter which you wish to enforce a maximum value upon. Action parameters have default maximum values so you only need to add this atom if you wish to override this default value. The atom ID should match the ID of the associated
kActionParameter
atom. Note that not all actions support this optional atom. This atom's parent is a
kAction
atom. The size of the leaf data depends on the parameter's data type.
-
For
MatrixRecord
parameters, the delta is concatenated with the current matrix. Each of the nine matrix elements are constrained (pinned or wrapped around their max and min) separately after the concatenation. This differs from scaler values in that overflow from the delta operation is not detected, so it is actually possible to have some elements wrap around even if the wrap around flag is not set. This can easily be avoided by choosing values for the matrix param, and min and max matrices.
-
Each matrix contains nine elements, and each element is concatenated separately. If you have matrices for specifying maximum and minimum values, you define maximum and minimum values for each of the individual matrix elements. If you do not provide matrices for specifying maximum and minimum values, the value of each element can wrap around if arithmetic overflow occurs. However, there is no checking for overflow when performing a delta operation on a matrix; this is in contrast to scalar values, for which overflow can always be checked.
-
For
ModifierTrackGraphicsModeRecord
parameters, the delta's RGBColor elements are each added to the current
ModifierTrackGraphicsModeRecord's
RGBColor elements. Each red, green, and blue element is constrained separately. As with
MatrixRecord
records, you can have
ModifierTrackGraphicsModeRecord
records that specify maximum and minimum values for each field of the record.
© 1999 Apple Computer, Inc.| Previous | Chapter Contents | Chapter Top | Next |